import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: "/home", component: () => import("../components/Layout"),
  },
  { path: "/lists", component: () => import("../components/lists/Lists") },
  {
    path: "/shopcar", component: () => import("../components/shopcars"),
  },
  { path: "/mine", component: () => import("../components/mine/Mine") },
  // {path:"/banner",component:()=>import("../components/banner")},
  {path:"/login",component:()=>import("../components/logins")},
  {path:"/regiest",component:()=>import("../components/reg")},
  {path:"/detail/:id",component:()=>import("../components/details")},
  {path:"/card/:id",component:()=>import("../components/card")},
  // {path:"/detail/info",component:()=>import("../components/details")},
  { path: "*", redirect: "/home" },
]

const router = new VueRouter({
  routes
})

// router.beforeEach((to,from,next)=>{
//    if(to.fullPath == "/login"){
//      next()
//      return
//    }
//    next("/login")
// })
export default router
